<?php echo form_open($this->curl . '/targeting/'.$this->validation->id, 'id="create_form" name="create_form"')?>
<?php echo form_hidden('id', $this->validation->id)?>
<br />
<table class="nostyle" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
	<td>
		<?php echo $this->validation->error_string?>
		<table class="nostyle" width="100%" border="0" cellpadding="3" cellspacing="0">
		<tr>
			<th style="width: 280px;"><?php echo $this->contributor_model->fields['fullname']?>:</th>
			<th><?php echo $user->fullname; ?></th>
		</tr>
		<tr>
			<th><?php echo T_('Тематика рекламы'); ?>:</th>
			<td>
				<table cellspacing="1" cellpadding="0" border="1" class="nostyle">
				<tr>
					<td style="vertical-align: top;">
						<p><strong><?php echo T_('Готов слушать:'); ?></strong></p>
						<div id="ajax_alltags">
							<?php echo form_dropdown('categories', $categories, null, 'multiple="multiple" size="14" style="width: 190px; height: 133px;" id="id_category"')?>
						</div>	
					</td>
					<td align="center" style="vertical-align: middle">
						<p>&nbsp;</p>
						<input type="button" title="Add" onclick="addSelectedToList('create_form','id_category','campaign_categories')" value="&gt;&gt;" class="clickable button_arrow_right"><br>
						<div style="width: 16px; height: 22px;"><img height="16" width="16" vspace="3" style="display: none;" src="/img/ajax-loader.gif" id="ajax_indicate_tags"></div>
						<input type="button" title="Remove" onclick="addSelectedToList('create_form','campaign_categories','id_category')" value="&lt;&lt;" class="clickable button_arrow_left">	
					</td>
					<td style="vertical-align: top">
						<p><strong><?php echo T_('Не готов слушать:'); ?></strong></p>
						<?php echo form_dropdown('campaign_categories[]', $this->validation->campaign_categories, null, 'id="campaign_categories" multiple="multiple" size="8" style="width: 190px; height: 133px;"')?>
					</td>
				</tr>
				</table>			
			</td>
		</tr>		 		
		<tr>
			<th><?php echo $this->contributor_model->fields['with_sms']?>:</th>
			<td>
				<?php
					$sms_enabled_1 = ($this->validation->with_sms == 1) ? true : false;
					$sms_enabled_0 = ($this->validation->with_sms == 0) ? true : false;
				 ?>
				<?php echo form_radio('with_sms', 1, $sms_enabled_1); ?> Да &nbsp; <?php echo form_radio('with_sms', 0, $sms_enabled_0); ?> Нет
			</td>
		</tr>		
		<tr>
			<th><?php echo $this->contributor_model->fields['with_email']?>:</th>
			<td>
				<?php
					$email_enabled_1 = ($this->validation->with_email == 1) ? true : false;
					$email_enabled_0 = ($this->validation->with_email == 0) ? true : false;
				 ?>
				<?php echo form_radio('with_email', 1, $email_enabled_1); ?> Да &nbsp; <?php echo form_radio('with_email', 0, $email_enabled_0); ?> Нет
			</td>
		</tr>		
				<tr>
			<th><?php echo $this->contributor_model->fields['with_destination']?>:</th>
			<td>
				<?php
					$destination_enabled_1 = ($this->validation->with_destination == 1) ? true : false;
					$destination_enabled_0 = ($this->validation->with_destination == 0) ? true : false;
				 ?>
				<?php echo form_radio('with_destination', 1, $destination_enabled_1); ?> Да &nbsp; <?php echo form_radio('with_destination', 0, $destination_enabled_0); ?> Нет
			</td>
		</tr>		
		<tr>
			<td colspan="2">&nbsp;</td>
		</tr>
		<tr>
			<td colspan="2">			
				<input name="edit" type="submit" class="input-submit" id="submit" value="<?php echo T_('Submit')?>" onclick="saveData();" />
				<input name="reset"  type="reset"  class="input-submit" id="reset" value="<?php echo T_('Reset')?>" onclick="$('#create_form input[type=text]').val('');" />
			</td>
		</tr>
		</table>
	</td>
</tr>
</table>
<?php echo form_close()?>

<script type="text/javascript">
	function saveData()
	{
		$('#campaign_categories option').each(function(){
			$(this).attr('selected', 'selected');
		})
	}		
</script>